<?php

class Application_Form_Clientes extends Zend_Form
{
    
    public function init()
    {

        $this->setMethod('post');
		$this->setAttrib('id', 'ajax_form');


		$this->setDecorators(
			array(	"FormElements",
					array("HtmlTag", array("tag" => "table")),
					"Form"
			)
		);

		$nombre=new Zend_Form_Element_Text('nombre');
        $nombre ->setLabel('Nombre')
                ->setRequired(true)
                ->setAttrib('size',150)
                ->addFilter('StringTrim')
                ->addValidator('StringLength', false,array(0, 150));

        $nif=new Zend_Form_Element_Text('nif');
        $nif ->setLabel('CIF o equivalente')
                ->setRequired(true)
                ->addFilter('StringTrim')
                ->addValidator('StringLength', false,array(0, 15));
                
                
        
        $raz_soc=new Zend_Form_Element_Text('raz_soc');
        $raz_soc->setLabel('Razón Social')
            ->setAttrib('size',150)
            ->addFilter('StringTrim')
            ->addValidator('StringLength', false,array(0, 100));
            
            
        $doc_soc=new Zend_Form_Element_Text('doc_soc');
        $doc_soc->setLabel('Domocilio')
            ->addFilter('StringTrim')
            ->setAttrib('size',150)
            ->addValidator('StringLength', false,array(0, 200));

        $fecha_alta= new Sgit_Form_Element_Fecha('f_alta');
        $fecha_alta->setLabel('Fecha Alta')
            ->setRequired(true);


	$this->addElement($nombre)
             ->addElement($nif)
             ->addElement($raz_soc)
             ->addElement($doc_soc)
             ->addElement($fecha_alta);
        
       $this->setElementDecorators(array(
		    'ViewHelper',
		   'Errors',
		    array(array('data' => 'HtmlTag'),	array('tag' => 'td', 'class' => 'element')   ),
		    array('Label', array('tag' => 'td')),
		    array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
		));
 
    }
}
